<template>
  <div class="box">
    <goodsname
      v-for="(item,i) in resultlist"
      :key="i"
      :goodsinfo="item"
      :title="item.goods_name" />
  </div>
</template>

<script>
import { getgoods } from '@/api/goods'
import goodsname from '@/components/goods-list/goodsname'
export default {
  data () {
    return {
      resultlist: []
    }
  },
  components: {
    goodsname
  },
  props: {
    searchkey: {
      type: String,
      required: true
    }
  },
  watch: {

  },
  created () {
    this.loadresult()
  },
  mounted () {

  },
  methods: {
    async loadresult() {
      const res = await getgoods({
        pageNum: 1,
        pageSize: 100,
        goods_name: this.searchkey
      })
      this.resultlist = res.data.data.rows
    }
  }
}
</script>

<style scoped lang="less">
.box {
  padding-top: 110px;
}
</style>
